package com.ekalenchuk.module.utils;

import java.io.Serializable;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ekalenchuk.module.config.context.ApplicationContextProvider;
import com.ekalenchuk.module.constants.PropertiesType;

public class Utils implements Serializable {

	private static final Logger logger = LoggerFactory.getLogger(Utils.class);

	private static final long serialVersionUID = 4933294295362498990L;
	private static final Properties facebookProps = ApplicationContextProvider.getApplicationContext().getBean("facebookProps", Properties.class);
	private static final Properties applicationProps = ApplicationContextProvider.getApplicationContext().getBean("applicationProps", Properties.class);
	

	public static String getProperty(final PropertiesType type, final String name) {
		String value = null;
		switch (type) {
		case APPLICATION:
			value = applicationProps.getProperty(name);
			break;
		case FACEBOOK:
			value = facebookProps.getProperty(name);
			break;
		default:
			break;
		}
		return value;
	}

}
